<?php

namespace app\controller\open;

use app\service\DeviceBaseService;
use app\validate\DeviceValidate;
use think\Log;

class DeviceController extends BaseOpenController{
    protected $beforeActionList = [
        'checkSign',
    ];

    public function initValidate()
    {
        $this->validate = new DeviceValidate();
    }

    public function report_action(){
        $params = $this->check();
        // trace("DeviceReport:".json_encode($params,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_SLASHES),Log::ERROR);
        $res = DeviceBaseService::upsetDevice($params,isset($params['children']) ? $params['children'] : '');
        return self::ok($params);
    }
}